Skip to content

Restore sidebar workspace icon size#4973

Open
austinywang wants to merge 21 commits into
mainfrom
fix-sidebar-icons-restore-size
Open

Restore sidebar workspace icon size#4973
austinywang wants to merge 21 commits into
mainfrom
fix-sidebar-icons-restore-size

Conversation

@austinywang
Copy link
Copy Markdown
Contributor

@austinywang austinywang commented May 29, 2026

Summary

  • restore extension sidebar workspace badge icons to the 28pt size used by the sidebar tile layout
  • restore release-era titlebar chrome sizing: 15pt icons in 24pt button lanes for the classic controls, with the old style scale preserved across titlebar variants
  • restore the 0.64.10 sidebar-toggle SF Symbol (sidebar.left) instead of the newer custom drawn glyph
  • keep the newer focus-history buttons, sidebar virtualization/drop layout, geometry reporting, and shared right-sidebar chrome metric path intact

Repro / Root Cause

Used local source diffing against v0.64.10, plus the user-provided screenshots. The shipped v0.64.10 titlebar controls used iconSize: 15, buttonSize: 24, spacing: 10, semibold symbols, and SF Symbol sidebar.left for the sidebar toggle. The later focus-history/titlebar chrome refactor shrank classic to compact shared values (12pt icons in 20pt lanes, regular weight) and replaced the sidebar toggle with a smaller custom glyph.

This fix restores the release-era titlebar icon/lane scale at the shared chrome metric root and restores the original SF Symbol path for the sidebar toggle, so the main titlebar controls and right-sidebar header controls stay in sync without a one-off frame override.

No cloud-mac video was recorded.

Testing

  • Not run locally per instruction.
  • Added regression assertions for the release-era titlebar chrome metrics and deterministic titlebar content width.
  • Added/kept regression assertions that right-sidebar header chrome derives from the shared titlebar chrome metrics.

Launch

Required command after approval:
CMUX_SKIP_ZIG_BUILD=1 ./scripts/reload.sh --tag fix-sidebar-icons-restore-size --launch

Summary by CodeRabbit

  • Refactor
    • Centralized sidebar sizing so tiles, icons, row heights, padding and corner radii are consistent across compact and regular modes and ensure icons fit.
  • UI
    • Right‑sidebar header icons and controls now use the app’s standard titlebar sizing with bolder icon weight for a clearer, more consistent appearance.
    • Titlebar control styles adjusted—spacing, icon/button sizes, corner radii and button visuals updated across styles.
  • Tests
    • Updated tests to validate the revised sizing, padding and layout metrics.

Review Change Stack


Note

Low Risk
Mostly visual layout and hit-region math with broad test coverage; no auth, data, or security paths touched.

Overview
Restores release-era (v0.64.10) titlebar chrome at the shared metric layer: larger classic lanes (15pt icons in 24pt buttons), semibold symbols, updated spacing/sizes across titlebar style presets, and sidebar.left instead of the custom sidebar glyph.

Minimal-mode sidebar titlebar is narrowed to three chrome actions (sidebar, notifications, new workspace). Layout, hit-testing, gap-drag, and accessory sizing now take an explicit buttonCount, use titlebarControlsSidebarChromeConfig to fit the fixed 124pt host (with optional shortcut-hint overflow only for those slots), and TitlebarControlsView can render a subset via actionSlots / styleConfigOverride.

Extension browser-stack sidebar rows/tiles pull dimensions from ExtensionBrowserStackSidebarMetrics (28pt icons, derived vertical padding with a debug assert).

Right-sidebar header chrome aligns with the shared titlebar button/icon sizes instead of smaller one-off values.

Reviewed by Cursor Bugbot for commit 13ee964. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmux Ready Ready Preview, Comment Jun 1, 2026 3:27am
cmux-staging Building Building Preview, Comment Jun 1, 2026 3:27am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Centralizes browser-stack sidebar sizing into ExtensionBrowserStackSidebarMetrics and updates tile/row views to use it; aligns header/icon/frame sizing with shared HeaderChromeControlMetrics, adjusts titlebar style presets, removes custom sidebar glyph, and updates tests to assert the new metrics.

Changes

Browser Stack Sidebar Metrics Refactoring

Layer / File(s) Summary
Metrics contract and sizing constants
Sources/ContentView.swift
New ExtensionBrowserStackSidebarMetrics enum defines shared iconSize, tileHeight, compact/regular row heights, and helpers for computing row padding and corner radius (with a precondition validating icon fits row height).
Tile view metric adoption
Sources/ContentView.swift
extensionBrowserStackTile now uses ExtensionBrowserStackSidebarMetrics for icon sizing and tile height, replacing hardcoded values while preserving selection and drag/drop behavior.
Row view dimension and styling refactor
Sources/ContentView.swift
extensionBrowserStackRow derives targetRowHeight, leading icon size, rowHorizontalPadding, rowVerticalPadding, and rowCornerRadius from metrics and applies them to padding and rounded-rectangle background/overlay for both compact and regular modes.

Header & Titlebar Metrics Update

Layer / File(s) Summary
Header chrome metrics and wiring
Sources/WindowChromeMetrics.swift
HeaderChromeControlMetrics sizing constants updated; RightSidebarChromeMetrics.headerIconSize now references HeaderChromeControlMetrics.iconSize and computes headerIconFrameSize via HeaderChromeControlMetrics.iconFrameSize(forIconSize:).
Header icon style weight change
Sources/RightSidebarChromeStyle.swift
HeaderChromeIconStyle.weight changed to .semibold for header icon rendering.
Titlebar control style adjustments
Sources/Update/UpdateTitlebarAccessory.swift
Updated TitlebarControlsStyle.config values for .classic, .compact, .roomy, .pillGroup, and .softButtons (spacing, icon/button sizes, badgeSize/badgeOffset, groupPadding, and buttonCornerRadius; .softButtons enforces buttonBackground).
Sidebar glyph removal and toggle update
Sources/Update/UpdateTitlebarAccessory.swift
Removed custom TitlebarSidebarGlyph and sidebarIconLabel; sidebar toggle now uses shared iconLabel(systemName: "sidebar.left"), and glyph-specific metric constant removed.
Tests updated to match shared metrics
cmuxTests/*
Tests renamed/updated to assert header/titlebar button/icon/frame/padding metrics derive from shared configs; deterministic content-size expectations adjusted and button-size variance tolerance widened.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • Ari4ka

Poem

🐰 I nudged the sizes into neat little stacks,
Icons queued by metrics, no more hardcoded hacks,
Tiles ask the helper, rows wear matching trims,
Headers grew bolder at the font-weight rims,
A happy hop — layout calm, tidy, and slim.

🚥 Pre-merge checks | ✅ 4 | ❌ 14

❌ Failed checks (1 warning, 13 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Cmux Swift Actor Isolation ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Blocking Runtime ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux No Hacky Sleeps ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Algorithmic Complexity ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Concurrency ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift @Concurrent ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift File And Package Boundaries ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Logging ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux User-Facing Error Privacy ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Full Internationalization ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swiftui State Layout ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Architecture Rethink ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
Cmux Swift Auxiliary Window Close Shortcuts ❓ Inconclusive Repository clone failed, so this custom check could not run with code access. Retry the review run. If this persists, inspect pre-merge custom-check logs for infrastructure or agent runtime failures.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Restore sidebar workspace icon size' accurately and concisely summarizes the main objective of the changeset—restoring icon sizing in the sidebar workspace. It is specific, clear, and reflects a primary purpose evident across the modified files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed PR description is comprehensive and follows template structure with Summary, Testing, and Launch sections.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-sidebar-icons-restore-size

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 29, 2026

Greptile Summary

This PR restores v0.64.10 visual fidelity across the extension sidebar and titlebar chrome. It centralizes sizing so the sidebar icon tile, list rows, and shared header controls all derive from the same metric roots instead of scattered magic numbers.

  • Extension sidebar: new ExtensionBrowserStackSidebarMetrics enum consolidates 28pt icon size, tile/row heights, padding, and corner radii; list rows stop using smaller compact icons and use the shared 28pt size.
  • Shared chrome: HeaderChromeControlMetrics restores 24×15pt button/icon sizes with 8pt corners; RightSidebarChromeMetrics derives barVerticalPadding from the shared button size (resolves to 2pt); HeaderChromeIconStyle switches to .semibold; sidebar toggle returns to the sidebar.left SF Symbol.
  • Titlebar layout: TitlebarControlsView gains actionSlots/styleConfigOverride; a new fittingConfig function shrinks any style preset to fit the 124pt minimal-sidebar host; the host width narrows from 164pt to 124pt for the three-button set; all style spacing and size presets are bumped to match the release era.

Confidence Score: 5/5

Safe to merge — changes are scoped to visual layout metrics and hit-region geometry with no auth, data, or networking paths touched.

All sizing changes are pure arithmetic on constant structs with no runtime side-effects. The fittingConfig two-pass shrink (buttons first, spacing second) is geometrically correct and verified by the new per-style fitting loop. MinimalModeSidebarControlActionSlot raw-value ordering aligns with sidebarChromeSlots order and is exercised by the hit-region probe tests. The barVerticalPadding formula resolves to 2pt (confirmed by test) and keeps controlHeight equal to headerControlSize. Regression assertions lock every metric changed by the PR, making silent regressions on future refactors unlikely.

No files require special attention.

Important Files Changed

Filename Overview
Sources/WindowChromeMetrics.swift Restores release-era chrome metrics (24pt buttons, 15pt icons, 8pt radii) and derives RightSidebarChromeMetrics.barVerticalPadding from the shared button size; test confirms it resolves to 2pt with the 28pt bar height.
Sources/RightSidebarChromeStyle.swift Upgrades HeaderChromeIconStyle.weight to .semibold and removes the now-unused sidebarGlyphStrokeWidth constant that backed the custom glyph path.
Sources/Update/UpdateTitlebarAccessory.swift Adds fittingConfig to shrink style presets for the constrained 124pt sidebar host, introduces sidebarChromeSlots/actionSlots/styleConfigOverride to limit visible buttons to three, replaces the custom glyph with the sidebar.left SF Symbol, and removes TitlebarSidebarGlyph.
Sources/Update/MinimalModeSidebarControls.swift Propagates buttonCount through all hit-testing, layout, and accessibility paths; visibleSlots correctly scopes accessibilityChildren to the active button count.
Sources/ContentView.swift Introduces ExtensionBrowserStackSidebarMetrics to centralize icon/row/padding/radius constants; list rows now always use the 28pt icon size and derived vertical padding instead of compact-vs-regular magic numbers.
Sources/WindowDragHandleView.swift Shrinks hostWidth from 164pt to 124pt to match the three-button chrome and switches titlebarControlsStyleConfig to use the fitted sidebar config.
cmuxTests/AppDelegateShortcutRoutingTests.swift Updates regression assertions to validate the restored chrome metrics and confirms right-sidebar header icons now derive from the shared titlebar icon size.
cmuxTests/UpdatePillReleaseVisibilityTests.swift Adds deterministic assertions for all style presets (icon, button, spacing, corner radius), sidebar chrome content-size budget, and per-style fitting safety within 124pt.
cmuxTests/WindowAndDragTests.swift Updates hit-region tests to assert three-button ranges and changes the probe point from the removed focus-history-back button to the newTab button.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[HeaderChromeControlMetrics\nbuttonSize=24 iconSize=15 cornerRadius=8] --> B[RightSidebarChromeMetrics\nbarVerticalPadding derived]
    A --> C[TitlebarControlsStyle.classic.config\nbuttonSize=24 iconSize=15 spacing=10]
    A --> D[HeaderChromeIconStyle\nweight=.semibold]

    C --> E{titlebarControlsSidebarChromeConfig}
    E -->|fittingConfig maxWidth=124pt| F[Fitted sidebarConfig\nshrinks if needed]

    C --> G[TitlebarControlsAccessoryViewController\nsidebarChromeSlots 3 buttons]
    F --> H[HiddenTitlebarSidebarControlsView\nstyleConfigOverride=fittedConfig]
    F --> I[MinimalModeSidebarControlActionProxyView\nbuttonCount=3]
    F --> J[TitlebarControlsGapDragView\nbuttonCount=3]
    F --> K[MinimalModeTitlebarButtonHitRegionView\nbuttonCount=3]

    L[ExtensionBrowserStackSidebarMetrics\niconSize=28 tileHeight=54] --> M[VerticalTabsSidebar tile row]
    L --> N[VerticalTabsSidebar list row\nrowHorizontalPadding rowVerticalPadding rowCornerRadius]
Loading

Reviews (12): Last reviewed commit: "merge: resolve conflicts with main" | Re-trigger Greptile

Comment thread Sources/ContentView.swift
Comment thread Sources/Update/MinimalModeSidebarControls.swift Outdated
Comment thread Sources/WindowDragHandleView.swift
@lugfug
Copy link
Copy Markdown

lugfug commented May 30, 2026

+1 for configurable sidebar icon size — same need on the icon side. The workspace icons are hard to distinguish at the current fixed size when a lot of tabs are open. Would love to see this land alongside sidebar font sizing.

@austinywang
Copy link
Copy Markdown
Contributor Author

@lugfug I kept this PR scoped to the visual regression: the default workspace sidebar icon size is restored to the v0.64.10-era 28pt size, and the sizing now comes from a shared metrics path so a future preference can drive it cleanly. I did not add a new user-facing icon-size setting here because that changes the settings/config surface and needs row-height/density behavior designed separately from this regression fix.

Comment thread Sources/ContentView.swift
Comment thread Sources/Update/UpdateTitlebarAccessory.swift Outdated
Branch had diverged behind main, which reworked the titlebar shortcut-hint
layout (#5045 clipping fix, #5059 hint alignment with defaultTitlebarHintX 4->0)
and shrank header chrome sizing. Resolution preserves the branch's intent
(restored release sizes 24/15/17/8, sidebar.left symbol, 3-slot sidebar chrome
button-count plumbing) while adopting main's newer hint-layout machinery:

- WindowChromeMetrics: keep restored sizes; add main's titlebarControlsLeadingPadding.
- TitlebarControlsHitRegions: keep sidebarChromeButtonCount/allTitlebarButtonCount
  (referenced widely by auto-merged code); adopt named outerLeadingPadding.
- contentSize: combine main's two-reservation clipping fix with the branch's
  buttonCount/reservesShortcutHintOverflow threading; bound
  titlebarHintLayoutRightmostExtent to the active slot count for sidebar chrome.
- Drop branch's superseded hint positioning (titlebarButtonRightEdge,
  hintRightSafetyShift) in favor of main's planner (hintInterval/titlebarHintPillWidth).
- Update regression anchors to merged behavior (defaultTitlebarHintX=0):
  classicWithShortcutHints 186->172, sidebar 118->104, roomy fitted spacing 7->14.

vendor/bonsplit working tree checked out to the merged pointer (adds isAudioMuted,
forkConversation* APIs that Workspace.swift now uses).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 13ee964. Configure here.

onFocusHistoryForward: focusHistoryForward,
visibilityMode: .alwaysVisible
visibilityMode: .alwaysVisible,
actionSlots: TitlebarShortcutHintActionSlot.sidebarChromeSlots
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Titlebar accessory drops history

High Severity

TitlebarControlsAccessoryViewController now passes actionSlots: TitlebarShortcutHintActionSlot.sidebarChromeSlots (three controls) into TitlebarControlsView, whose default is all cases. Non-minimal workspace windows therefore lose focus back/forward in the system titlebar, contradicting the stated goal to keep those buttons.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 13ee964. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants